<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>string对象 </title>
    <script type="text/javascript">
        var message = "I love JavaScript!";
        var mychar = message.toLowerCase();
        document.write("字符串长度为：" + mychar.length + "<br>");
        document.write("字符串为：" + mychar + "<br>");
        document.write("字符串为：" + mychar.toUpperCase() + "<br>");
        document.write("字符串最后一个字符为：" + mychar.charAt(mychar.length - 1) + "<br>");
        document.write("第二个字符ｏ出现的位置为：" + mychar.indexOf("o", 0) + "<br>");

    </script>
</head>
<body>
</body>
</html>